new Vue({
    el: "#app",
    data() {
        return {
            pickerOptions: pickerOptions,
            activeName: 'first',
            tabs: [{ label: '采购', value: 'first' }, { label: '销售', value: 'second' }],
            form: {
                id: '',
                Status:2,
                pageNumber: 1,
                pageSize: 10,
            },
            total: 0,
            tableData: [],
        };
    },
    mounted() {
        this.form.id = getQueryObject().Enterprise_Info_SerialNumber;
        this.getList(this.form);
    },
    methods: {
        onSerach() {
            this.getList(this.form);
        },
        getList(data) {
            const _this = this;
            if (this.activeName == 'first') {
                $.ajax({
                    headers: requestHeaders(),
                    type: "get",
                    url: `https://service.kdddy.cn/donghuiForRequest/selectContract/ByEnterprise`,
                    data,
                    success: function (Result) {
                        _this.total = Result.total;
                        _this.tableData = Result.Data;
                    },
                    dataType: "json",
                });
            } else {
                $.ajax({
                    headers: requestHeaders(),
                    type: "get",
                    url: `https://service.kdddy.cn/donghuiForRequest/GetContract/ByEnterprise`,
                    data,
                    success: function (Result) {
                        _this.total = Result.total;
                        _this.tableData = Result.Data;
                    },
                    dataType: "json",
                });
            }
        },
        handleSizeChange(val) {
            console.log(val);
            this.form.pageNumber = 1;
            this.form.pageSize = val;
            this.getList(this.form);
        },
        handleCurrentChange(val) {
            this.form.pageNumber = val;
            this.getList(this.form);
        },
        filterTag4(value, row) {
            return row.Acceptance_Status === value;
        },
    },
});
